(function(){/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ var aa=this||self;function k(a,b){a=a.split(".");var c=aa;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b}function m(a,b){function c(){}c.prototype=b.prototype;a.ma=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.sa=function(d,f,e){for(var g=Array(arguments.length-2),h=2;ha.length?!1:N(Ja,a)}function Na(a){return N(Ea,a)?O(a,ya):O(a,K)}function Oa(a){var b=Na(a.toString());C(a);a.g(b)}function Pa(a){return null!=a&&(1!=w(a,9)||-1!=t(a,9)[0])}function O(a,b){for(var c=new B,d,f=a.length,e=0;eb?2:e[e.length-1]=f&&f<=d;++f)if(c=parseInt(a.substring(0,f),10),c in I)return b.g(a.substring(f)),c;return 0} function Xa(a,b,c,d,f,e){if(0==b.length)return 0;b=new B(b);var g;null!=c&&(g=q(c,11));null==g&&(g="NonMatch");var h=b.toString();if(0==h.length)g=20;else if(L.test(h))h=h.replace(L,""),C(b),b.g(Na(h)),g=1;else{h=new RegExp(g);Oa(b);g=b.toString();if(0==g.search(h)){h=g.match(h)[0].length;var l=g.substring(h).match(Aa);l&&null!=l[1]&&0=b.h.length)throw Error("Phone number too short after IDD"); a=Wa(b,d);if(0!=a)return r(e,1,a),a;throw Error("Invalid country calling code");}if(null!=c&&(g=v(c,10),h=""+g,l=b.toString(),0==l.lastIndexOf(h,0)&&(h=new B(l.substring(h.length)),l=q(c,1),l=new RegExp(v(l,2)),Ya(h,c,null),h=h.toString(),!N(l,b.toString())&&N(l,h)||3==X(a,b.toString(),c,-1))))return d.g(h),f&&r(e,6,10),r(e,1,g),g;r(e,1,0);return 0} function Ya(a,b,c){var d=a.toString(),f=d.length,e=q(b,15);if(0!=f&&null!=e&&0!=e.length){var g=new RegExp("^(?:"+e+")");if(f=g.exec(d)){e=new RegExp(v(q(b,1),2));var h=N(e,d),l=f.length-1;b=q(b,16);if(null==b||0==b.length||null==f[l]||0==f[l].length){if(!h||N(e,d.substring(f[0].length)))null!=c&&0=b.length)e="";else{var g=b.indexOf(";",e);e=-1!==g?b.substring(e,g):b.substring(e)}var h=e;null==h?g=!0:0===h.length?g=!1:(g=Fa.exec(h),h=Ga.exec(h),g=null!==g||null!==h);if(!g)throw Error("The string supplied did not seem to be a phone number"); null!=e?("+"===e.charAt(0)&&f.g(e),e=b.indexOf("tel:"),f.g(b.substring(0<=e?e+4:0,b.indexOf(";phone-context=")))):(e=f.g,g=b??"",h=g.search(Ba),0<=h?(g=g.substring(h),g=g.replace(Da,""),h=g.search(Ca),0<=h&&(g=g.substring(0,h))):g="",e.call(f,g));e=f.toString();g=e.indexOf(";isub=");0b.h.length)throw Error("The string supplied is too short to be a phone number");null!=g&&(c=new B,f=new B(b.toString()),Ya(f,g,c),a=X(a,f.toString(),g,-1),2!=a&&4!=a&&5!=a&&(b=f,d&&0a)throw Error("The string supplied is too short to be a phone number");if(17{try{const c=a.replace(/[^+0-9]/g,""),d=new $a(b);let f="";for(let e=0;e{try{const f=J.g(),e=Y(f,a,b);var d=Va(f,e);return 0==d||4==d?Ra(f,e,"undefined"===typeof c?0:c):a}catch(f){return a}}); k("intlTelInputUtils.getExampleNumber",(a,b,c)=>{try{const h=J.g();a:{var d=h;if(P(a)){var f=U(T(d,a),c);try{if(p(f,6)){var e=q(f,6);var g=Za(d,e,a,!1);break a}}catch(l){}}g=null}return Ra(h,g,b?2:1)}catch(h){return""}});k("intlTelInputUtils.getExtension",(a,b)=>{try{return q(Y(J.g(),a,b),3)}catch(c){return""}});k("intlTelInputUtils.getNumberType",(a,b)=>{try{const h=J.g();var c=Y(h,a,b);a=h;var d=Ta(a,c),f=R(a,v(c,1),d);if(null==f)var e=-1;else{var g=Q(c);e=V(g,f)}return e}catch(h){return-99}}); k("intlTelInputUtils.getValidationError",(a,b)=>{try{const c=J.g(),d=Y(c,a,b);return Va(c,d)}catch(c){return"Invalid country calling code"===c.message?1:3>=a.length||"Phone number too short after IDD"===c.message||"The string supplied is too short to be a phone number"===c.message?2:"The string supplied is too long to be a phone number"===c.message?3:-99}}); k("intlTelInputUtils.isValidNumber",(a,b)=>{try{const l=J.g();var c=Y(l,a,b);a=l;var d=Ta(a,c);var f=v(c,1),e=R(a,f,d);if(null==e||"001"!=d&&f!=Ua(a,d))var g=!1;else{var h=Q(c);g=-1!=V(h,e)}return g}catch(l){return!1}});k("intlTelInputUtils.isPossibleNumber",(a,b)=>{try{const c=J.g(),d=Y(c,a,b),f=0===Va(c,d);a=!0;const e=q(d,2).toString();"gb"===b&&"7"===e.charAt(0)&&(a=10===e.length);return f&&a}catch(c){return!1}});k("intlTelInputUtils.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3}); k("intlTelInputUtils.numberType",{FIXED_LINE:0,MOBILE:1,FIXED_LINE_OR_MOBILE:2,TOLL_FREE:3,PREMIUM_RATE:4,SHARED_COST:5,VOIP:6,PERSONAL_NUMBER:7,PAGER:8,UAN:9,VOICEMAIL:10,UNKNOWN:-1});k("intlTelInputUtils.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,IS_POSSIBLE_LOCAL_ONLY:4,INVALID_LENGTH:5});})();